package com.base.monitor.model.enums.code.impl.biz.cfg;

import com.base.monitor.model.enums.code.BaseCode;
import lombok.AllArgsConstructor;

/**
 * @description:
 * @author: tsing
 * @create: 2020-08-09 15:03
 */
@AllArgsConstructor
public enum CfgCode implements BaseCode {

    // 4.4.配置相关(4301~4399)
    NO_FILE_UPLOAD(false, 6000, "上传excel时，没有excel文件"),
    ILLEGAL_EXTENSION(false, 6001, "文件类型非法"),
    READ_EXCEL_ERROR(false, 6002, "excel文件读取失败"),
    PARAM_ILLEGAL_FOR_UPLOAD(false, 6003, "excel导入时参数非法"),
    ILLEGAL_IP_ADDRESS(false, 6004, "非法的ip地址"),
    INDICATOR_IS_NOT_EXIST(false, 6005, "指标不存在"),
    IP_ADDRESS_IS_EXIST(false, 6006, "ip地址已存在"),
    EXIST_SAME_NAME_DEVICE(false, 6007, "设备已重名"),
    DEVICE_NAME_IS_NULL(false, 6008, "设备名称为空"),
    TAKE_BIT_LENGTH_IS_NOT_EQUALS_PARSE_SCALE_LENGTH(false, 6009, "取位长度和解析进制长度不一致"),
    ;

    private Boolean success; // 是否成功
    private int code; // 状态码
    private String message; // 操作信息

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
